home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Merciful 5
/
Merciful - Disc 5.iso
/
software
/
a
/
amftpv1.77cr.lha
/
AmFTP
/
Rexx
/
send.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1997-03-20
|
2KB
|
68 lines
/*
AmFTP Rexx-Port Example Script, receive.rexx
Copyright © 1995-1996 by Mathias Mischler, All Rights Reserved.
This script was written to show the use of the AmFTP Rexx Port,
because the is a major AmFTP-Rexx problem: AmFTP is a asyncronious
program, so we _can't_ just start a command and than next one.
Solution: What we have to do, is to _initiate_ a command, wait until
command is ready and than initiate next one (wait for this...).
AmFTP provides following functions to easy handle this:
INACTION:
INACTION returns 0 when AmFTP is free to get new commands.
returns 1 when AmFTP is busy on working.
WAITACTION PORT:
WAITACTION tells AmFTP to send a message to a specified MessagePort
when it is ready with last command. So you can just do a WAITPKT.
This example shows how to wait on such messages. We need to open
rexxsupport.library to use
OPENPORT to create a MessagePort,
CLOSEPORT to close a MessagePort and
WAITPKT to wait for a message from AmFTP.
(See also rexx.guide OPENPORT, CLOSEPORT, WAITPKT)
*/
/* Open rexxsupport.library, and AMFTP Rexx-Port */
OPTIONS RESULTS
ADDLIB("rexxsupport.library",0,-30,0)
RXLIB "AMFTP.1"
ADDRESS 'AMFTP.1'
/* Create MessagePort */
CALL OPENPORT("AMFTP-RESULT.1")
/* Change local directory */
say "Change local directory..."
CHANGELOCALDIR "RAM:"
/* Sending a file 'a'*/
say "Sending ..."
SEND "a"
WAITACTION "AMFTP-RESULT.1"
CALL WAITPKT "AMFTP-RESULT.1"
LASTRC
say RESULT
/* Sending a file 'b'*/
say "Sending ..."
SEND "b"
WAITACTION "AMFTP-RESULT.1"
CALL WAITPKT "AMFTP-RESULT.1"
LASTRC
say RESULT
/* Close Connection */
CLOSE
/* Close our MessagePort */
CALL CLOSEPORT "AMFTP-RESULT.1"